
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j">
	
<body> 
 <ui:composition template="/templates/default/template.xhtml">
    <ui:define name="body">
      
    <h:panelGrid columns="1" style="margin-left:5px;width:100%">
    	<!--  tieu de -->
    	<h:panelGrid columns="1" styleClass="columPanelbaritemTitle">
	  		<h:outputText value="Thông tin thành viên" styleClass="panelbaritemTitle"></h:outputText>
	  	</h:panelGrid>
	  	<!-- ket thuc tieu de -->
		<!-- phan noi dung phia duoi -->	  
    	<h:panelGrid columns="1" styleClass="panelGridBody">
    			<!-- Bat dau noi dung ben trong -->
		    <rich:panel style="background:#FFFFFF">
		    <h:form id="taomoidoanvao">  
		    	<h:panelGrid columns="1" style="margin-left:10px;">
		    		<h:outputText id="idError" value="#{nguoiVao.error}" style=" color: red;"></h:outputText>
				</h:panelGrid>	
				<h:panelGrid columns="2" style="margin-left:10px;">
		    		<h:outputText value="Mã đoàn : " style="margin-left:15px;" styleClass="inputText" ></h:outputText>
		    		<h:inputText id="mD" readonly="true" value="#{nguoiVao.maDoan}" size="20"/>
		    
		     		<h:outputText value="Số HC(*): " style="margin-left:15px;" styleClass="inputText" ></h:outputText>
		    		<h:inputText  value="#{nguoiVao.soHC}" id="text" size="20"/>
		     
		     		<h:outputText value="Tên(*): " id="idout" style="margin-left:15px;" styleClass="inputText" ></h:outputText>
		    		<h:inputText id="ten" value="#{nguoiVao.ten}" size="20"/>	
		    	
		    		<h:outputText value="Giới tính:" style="margin-left:15px;" styleClass="inputText" >
		       		</h:outputText>
		       	   	<h:selectOneMenu value="#{nguoiVao.gioiTinh}" styleClass="InputControl">
				    <f:selectItems  value="#{nguoiVao.listGioiTinh}"/>	
		    		</h:selectOneMenu>	  		
		       	
		       		<h:outputText value="CMND(*):  " style="margin-left:15px;"  styleClass="inputText" ></h:outputText>
		    		<h:inputText id="cmnd" readonly="#{nguoiVao.display}" value="#{nguoiVao.cmnd}" size="20" />
		    	
		    		<h:outputText value="Quốc tịch(*):" style="margin-left:15px;" styleClass="inputText" ></h:outputText>
    				<h:inputText id="quocTich" value="#{nguoiVao.quocTich}" size="20" />
		    	
			    	<h:outputText value="Nghề nghiệp:  " style="margin-left:15px;"  styleClass="inputText" ></h:outputText>
		      		<h:inputText id="ngheNghiep" value="#{nguoiVao.ngheNghiep}" size="20" />
		    	
		    		<h:outputText value="Ngày cấp HC(*):  " style="margin-left:15px;"  styleClass="inputText" ></h:outputText>
		      		<rich:calendar popup="true" id="ngayCapHC" size="5px" value="#{nguoiVao.ngayCapHC}" datePattern="dd/MM/yyyy" currentDate="#{nguoiVao.ngayCapHC}">
					</rich:calendar>
					
					<h:outputText value="Ngày hết hạn HC(*):  " style="margin-left:15px;"  styleClass="inputText" ></h:outputText>
		      		<rich:calendar popup="true" id="ngayHetHanHC" size="5px" value="#{nguoiVao.ngayHetHanHC}" datePattern="dd/MM/yyyy" currentDate="#{nguoiVao.ngayHetHanHC}">
					</rich:calendar>
					
					<h:outputText value="Ngày hết hạn Visa(*):  " style="margin-left:15px;"  styleClass="inputText" ></h:outputText>
		      		<rich:calendar popup="true" id="ngayHetHanVisa" size="5px" value="#{nguoiVao.ngayHetHanVisa}" datePattern="dd/MM/yyyy" currentDate="#{nguoiVao.ngayHetHanVisa}">
					</rich:calendar>
					
					</h:panelGrid>	
					
				<h:panelGrid columns="3" style="margin-left:10px;">
		    		<h:outputText value="Hình ảnh:" style="margin-left:15px;" styleClass="inputText" ></h:outputText>
    			    <h:graphicImage value="#{nguoiVao.hinhAnh}" style="margin-left:59px;"></h:graphicImage>
					<a4j:commandButton value="Hình ảnh..." styleClass="Button" action="#{nguoiVao.layHinhAnh}"></a4j:commandButton>
			    </h:panelGrid>
			    
								
				<h:panelGrid columns="4" style="margin-left:150px;margin-top:10px;margin-bottom:1px">
			    	<a4j:commandButton value="Tạo mới" styleClass="Button" action="#{nguoiVao.taoMoiNguoiVao}"></a4j:commandButton>
			    	<a4j:commandButton value="Cập nhật" styleClass="Button" action="#{nguoiVao.capNhatThongTin}"></a4j:commandButton>
			    	<a4j:commandButton type="Button" value="Hủy bỏ cập nhật" styleClass="Button" action="#{nguoiVao.huyBoCapNhat}"></a4j:commandButton>
			     	<a4j:commandButton type="Button" value="Hoàn thành" styleClass="Button" action="#{nguoiVao.hoanThanhThemMoi}"></a4j:commandButton>
			     </h:panelGrid>		
			     </h:form>
		  	 </rich:panel>	
			  <h:panelGrid columns="1" style="margin-left:0px;">		       		
		       		<h:outputText value="Danh sách thành viên " styleClass="inputText" ></h:outputText>		       			    		
				</h:panelGrid>
					
			<!-- Bat dau table -->
					<h:form>
					<h:dataTable id="list" value="#{nguoiVao.listTableNguoiVao}" var="Item" 
								columnClasses="column" headerClass="TableHeader" rowClasses="ROW1,ROW2" footerClass="TableFooter" 
					       style="width:100%; margin-left:0px;margin-top: 10px" cellspacing="1px;" rows="10">
						<h:column >
							<f:facet name="header">
								<h:outputText value="STT"></h:outputText>
							</f:facet>
							<h:outputText value="#{Item.stt}"></h:outputText>
							<f:facet name="footer">
								<rich:spacer></rich:spacer>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Tên thành viên"></h:outputText>
							</f:facet>
							<h:outputText value="#{Item.ten}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Số HC"></h:outputText>
							</f:facet>
							<h:outputText value="#{Item.soHC}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Quốc tịch"></h:outputText>
							</f:facet>
							<h:outputText value="#{Item.quocTich}"></h:outputText>
						</h:column>
							<h:column>
							<f:facet name="header">
								<h:outputText value="Nghề nghiệp"></h:outputText>
							</f:facet>
							<h:outputText value="#{Item.ngheNghiep}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Xóa" ></h:outputText>
							</f:facet>
							<a4j:commandLink  action="#{nguoiVao.xoaNguoiVao}"
											onclick="if(!confirm('Bạn muốn xóa thành viên này ?')) 
							 							{return false;}">
								<h:graphicImage value="/qldoanra/func01/images/icoDelete.gif"></h:graphicImage>
								<f:param name="id" value="#{Item.id}" />
								</a4j:commandLink>
						</h:column>				
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sửa"></h:outputText>
							</f:facet>
							 <a4j:commandLink  action="#{nguoiVao.loadThongTin}">
							 	<h:graphicImage value="/quantri/pqcn/images/icoEdit.gif"></h:graphicImage>
							 	<f:param name="id" value="#{Item.id}"/>
							 	<f:param name="soHC" value="#{Item.soHC}"/>
							 	<f:param name="gioiTinh" value="#{Item.gioiTinh}"/>
							 	<f:param name="ten" value="#{Item.ten}"/>
							 	<f:param name="cmnd" value="#{Item.cmnd}"/>
							 	<f:param name="quocTich" value="#{Item.quocTich}"/>
							 	<f:param name="ngheNghiep" value="#{Item.ngheNghiep}"/>
							 	<f:param name="ngayCapHC" value="#{Item.strNgayCapHC}"/>
							 	<f:param name="ngayHetHanHC" value="#{Item.strNgayHetHanHC}"/>
							 	<f:param name="ngayHetHanVisa" value="#{Item.strNgayHetHanVisa}"/>
							  </a4j:commandLink>
						</h:column>
				
					</h:dataTable>
						<!-- phan trang -->
						<rich:datascroller align="right"  for="list" maxPages="5" />
						<!-- ket thuc phan trang -->			
				</h:form>	
				
    </h:panelGrid>
   </h:panelGrid>
 
 </ui:define>
 </ui:composition> 
</body>	
</html>